import { BrowserRouter } from "react-router-dom";
// import nprogress from "nprogress";
import zhCN from "antd/locale/zh_CN";
import { ConfigProvider, App } from "antd";
import { AliveScope } from "react-activation"; // keepalive
import Page from "./page";
import StaticAntd from "@/utils/staticAntd";
import RouterBeforeEach from "./utils/RouterBeforeEach";

const Router = () => {
	return (
		<BrowserRouter>
			<ConfigProvider
				locale={zhCN}
				theme={{
					token: {
						colorPrimary: "#005EFF"
					},
					components: {
						Button: {
							borderRadius: 4
						}
					}
				}}
			>
				<App>
					<StaticAntd />
					<AliveScope>
						<RouterBeforeEach>
							<Page />
						</RouterBeforeEach>
					</AliveScope>
				</App>
			</ConfigProvider>
		</BrowserRouter>
	);
};

export default Router;
